{include file="public/header"/}
<link rel="stylesheet" href="{__PUBLIC_PATH}/admin/pcf/pcfbase1.css?v={$version}"/>
<script src="{__PUBLIC_PATH}/common/js/jquery.js?v={$version}"></script>
<script src="{__PUBLIC_PATH}/admin/pcf/global.js?v={$version}"></script>
</head>
<body>
<style>
  .pcfts{font: bold 14px/20px tahoma,verdana;color:#F60;vertical-align:middle;display:inline-block;margin-right:5px;margin-left:-14px;}
  .layui-layer-content{height:auto!important;} 
  .layui-form-selected dl{z-index: 999999 !important;}
  .pcfwidth1{margin-top:5px;}
  @media screen and (max-width:1000px){
    .pcfwidth{width:100%!important;}
  }
  @media screen and (max-width:450px){
    .pcfwidth1{margin-top:0px!important;}
    .pcfshow{display:block!important;}
  }
</style>
<div class="layui-form" id="LAY-component-layer-list">
    <div class="layui-fluid" style="padding-bottom:83px;">
        <div class="layui-card">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                  <div class="layui-form-item layui-col-xs6 pcfwidth">
                    <label class="layui-form-label"><b class="pcfts">*</b> 广告名称</label>
                    <div class="layui-input-block">
                     <input type="text" name="title" id="title" value="" class="layui-input" lay-verType="tips" lay-verify="required" required>
                    </div>
                  </div>
                  <div class="layui-form-item layui-col-xs6 pcfwidth">
                    <label class="layui-form-label">广告描述</label>
                    <div class="layui-input-block">
                        <textarea name="content" class="layui-textarea"></textarea>
                    </div>
                  </div>
                </div>
            </div>
            <div style="clear:both;"></div>
        </div>
    </div>
    <div class="submit-info text-center">
        <button class="layui-btn" lay-submit lay-filter="formSubmit">确认提交</button>
        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
    </div>
</div>
{include file="public/footer"/}
<script>
    layui.use(['layer', 'form'], function(){
        var $ = layui.$,
            layer = layui.layer,
            form = layui.form;
            form.render();
            //监听提交
            form.on('submit(formSubmit)', function(data){
                layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
                $.ajax({
                    type : 'post',
                    url : "{:url('/channel.adposition/add')}",
                    data : data.field,
                    dataType : 'json',
                    success : function(res){
                        layer.closeAll('loading');
                        if(res.status){
                            layer.msg(res.msg, {icon: 1, time: 1000}, function(){
                                parent.window.location.href = res.url;
                            });
                        }else{
                            layer.msg(res.msg, {icon: 2, time: 1000});
                        }
                    },
                    error: function(e){
                        layer.closeAll('loading');
                        layer.msg("未知错误，操作中断！", {icon: 2, time: 1000});
                    }
                });
                return false;
            });
    });
</script>